package com.company.cloud.product.modules.api.response;

import com.company.cloud.behavior.modules.api.response.BehaviorSearchAllModel;
import com.company.cloud.company.modules.api.response.CompanySimple;
import com.company.cloud.tag.modules.api.response.Label;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Getter
@Setter
public class Product extends ProductSimple {

    @ApiModelProperty(value = "公司编号")
    private String companyNo;

    @ApiModelProperty(value = "公司名称")
    private String companyName;

    @ApiModelProperty(value = "公司分类")
    private String companyType;

    @ApiModelProperty(value = "公司Logo")
    private String companyLogo;

    @ApiModelProperty(value = "公司信息")
    private CompanySimple company;

    @ApiModelProperty(value = "语言分类")
    private String langType;

    @ApiModelProperty(value = "主商品编号")
    private String mainProductNo;

    @ApiModelProperty(value = "主公司编号")
    private String mainCompanyNo;

    @ApiModelProperty(value = "商品分类")
    private Integer categoryId;

    @ApiModelProperty(value = "商品品牌ID")
    private Integer brandId;

    @ApiModelProperty(value = "商品一级类型")
    private String type;

    @ApiModelProperty(value = "商品二级类型")
    private String twoType;

    @ApiModelProperty(value = "商品分享名称")
    private String shareName;

    @ApiModelProperty(value = "介绍")
    private String introduction;

    @ApiModelProperty(value = "创建时间")
    private String ctime;

    @ApiModelProperty(value = "成本价")
    private BigDecimal cost;

    @ApiModelProperty(value = "市场价")
    private BigDecimal marketPrice;

    @ApiModelProperty(value = "销售价")
    private BigDecimal price;

    @ApiModelProperty(value = "单位")
    private String unit;

    @ApiModelProperty(value = "重量")
    private Integer weight;

    @ApiModelProperty(value = "保质期(天)")
    private Integer lifeDay;

    @ApiModelProperty(value = "是否上架")
    private String isMarketable;

    @ApiModelProperty(value = "修改时间")
    private String edt;
    @ApiModelProperty(value = "分类名称")
    private String treePath;
    @ApiModelProperty(value = "排序")
    private Integer orders;

    @ApiModelProperty(value = "备注")
    private String memo;

    @ApiModelProperty(value = "是否支持分销")
    private String isDis;

    @ApiModelProperty(value = "分润设置分类")
    private String disProfitType;

    @ApiModelProperty(value = "是否支持退换货")
    private String isExchangePurchase;

    @ApiModelProperty(value = "是否限购")
    private String isBuyLimit;

    @ApiModelProperty(value = "限购数量")
    private Integer buyLimitNum;

    @ApiModelProperty(value = "赠送积分")
    private Integer rewardPoint;

    @ApiModelProperty(value = "兑换积分")
    private Integer exchangePoint;

    @ApiModelProperty(value = "商品标签值")
    private String tagValues;

    @ApiModelProperty(value = "搜索关键词")
    private String keyword;

    @ApiModelProperty(value = "商品图片")
    private String productImages;

    @ApiModelProperty(value = "业务扩展1")
    private String bizValue1;

    @ApiModelProperty(value = "业务扩展2")
    private String bizValue2;

    @ApiModelProperty(value = "业务扩展3")
    private String bizValue3;

    @ApiModelProperty(value = "业务扩展4")
    private String bizValue4;

    @ApiModelProperty(value = "业务扩展5")
    private String bizValue5;

    @ApiModelProperty(value = "业务扩展6")
    private String bizValue6;

    @ApiModelProperty(value = "业务扩展7")
    private String bizValue7;

    @ApiModelProperty(value = "业务扩展8")
    private String bizValue8;

    @ApiModelProperty(value = "业务扩展9")
    private String bizValue9;


    @ApiModelProperty(value = "业务扩展10")
    private String bizValue10;


    @ApiModelProperty(value = "业务扩展11")
    private String bizValue11;


    @ApiModelProperty(value = "业务扩展12")
    private String bizValue12;


    @ApiModelProperty(value = "业务扩展13")
    private String bizValue13;


    @ApiModelProperty(value = "业务扩展14")
    private String bizValue14;


    @ApiModelProperty(value = "业务扩展15")
    private String bizValue15;


    @ApiModelProperty(value = "业务扩展16")
    private String bizValue16;


    @ApiModelProperty(value = "业务扩展17")
    private String bizValue17;


    @ApiModelProperty(value = "业务扩展18")
    private String bizValue18;


    @ApiModelProperty(value = "业务扩展19")
    private String bizValue19;


    @ApiModelProperty(value = "业务扩展20")
    private String bizValue20;


    @ApiModelProperty(value = "业务扩展21")
    private String bizValue21;


    @ApiModelProperty(value = "业务扩展22")
    private String bizValue22;


    @ApiModelProperty(value = "业务扩展23")
    private String bizValue23;


    @ApiModelProperty(value = "业务扩展24")
    private String bizValue24;


    @ApiModelProperty(value = "业务扩展25")
    private String bizValue25;


    @ApiModelProperty(value = "业务扩展26")
    private String bizValue26;


    @ApiModelProperty(value = "业务扩展27")
    private String bizValue27;


    @ApiModelProperty(value = "业务扩展28")
    private String bizValue28;

    @ApiModelProperty(value = "作家列表")
    private List<Map<String, Object>> artists;


    @ApiModelProperty(value = "作家姓名")
    private String artistNames;


    @ApiModelProperty(value = "运费")
    private BigDecimal freightFee;

    @ApiModelProperty(value = "支持的装裱")
    private Set<String> mounts;

    @ApiModelProperty(value = "SEO关键字")
    private String metaKeywords;

    @ApiModelProperty(value = "SEO描述信息")
    private String metaDescription;

    @ApiModelProperty(value = "是否支持代理")
    private String isAgent;

    @ApiModelProperty(value = "代理分成分类")
    private String agentProfitType;

    @ApiModelProperty(value = "第三方平台商品URL")
    private String thirdProductUrl;

    @ApiModelProperty(value = "修改项")
    private String editItems;

    @ApiModelProperty(value = "销售数量")
    private Integer saleNum;

    @ApiModelProperty(value = "主公司名称")
    private String mainCompanyName;

    @ApiModelProperty(value = "商品分类名称")
    private String categoryName;

    @ApiModelProperty(value = "商品品牌名称")
    private String brandName;

    @ApiModelProperty(value = "分销参数设置")
    private ProductDisProfitModel disProfitConfig;

    @ApiModelProperty(value = "标签")
    private List<Label> tagItems;

    @ApiModelProperty(value = "商品图片")
    private List<ProductImageItem> imageItems;

    @ApiModelProperty(value = "规格")
    private List<ProductSpecificationItem> specificationItems;

    @ApiModelProperty(value = "收藏/评论/关注/点赞")
    private BehaviorSearchAllModel behavior;

    @ApiModelProperty(value = "SKU")
    private List<ProductSkuItem> skuItems;

    @ApiModelProperty(value = "库存数量")
    private BigDecimal stockNum;

    @ApiModelProperty(value = "冻结数量")
    private BigDecimal freezeNum;

    @ApiModelProperty(value = "审核状态")
    private String state;

    public void addSKU(ProductSkuItem item) {
        if (this.skuItems == null) {
            this.skuItems = new ArrayList<ProductSkuItem>();
        }
        if (item != null) {
            this.skuItems.add(item);
        }
    }


    public void addArtist(Map<String, Object> item) {
        if (this.artists == null) {
            this.artists = new ArrayList<Map<String, Object>>();
        }
        if (item != null) {
            this.artists.add(item);
        }
    }

    public void addArtistName(String name) {
        if (name == null || "".equals(name)) {
            return;
        }
        if (this.artistNames == null || "".equals(this.artistNames)) {
            this.artistNames = name;
        } else {
            this.artistNames = this.artistNames + "," + name;
        }
    }

}
